package com.pro.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.Objects;

/**
 * ClassName:JsUserOrders
 * Package:com.pro.pojo
 * Description:
 *
 * @Date:2021/11/8 下午 7:44
 * @Author: WYH
 */
public class JsUserOrder {

    private long orderId;//主键id
    private long userId;//外键，用户表id
    private String trueName;//后台用户名称
    private String nickname;//用户姓名
    private String phone;//手机号
    private Integer productId;
    private Integer courseId;
    private String courseName;//课程名称
    private String courseIntro;//课程简介
    private String productName;//商品名称
    private String productDescription;//商品描述，简介
    private String roleName;//商家
    private long addressId;//用户地址主键
    private long userNumber;//用户编号
    private long orderNo;//供客户查询编号
    private long shopId;//购买编号
    private long orderStatus;//订单状态，2未付款，3已付款，4待发货，5已发货，6已签收，7退货申请，8退货中
    private long productCount;//商品数量
    private double priceTotal;//商品总价
    private double logisticsFee;//订单金额
    private double freightAmount;//运费金额
    private long orderLogisticsNumber;//订单物流编号
    private long orderType;//商品类型，2视频，3商品
    private long orderPaymentChannel;//订单支付渠道，2微信支付，3余额支付
    private long paymentOrderNo;//订单支付单号，第三方支付流水号
    private String receivingAddress;//收货地址，外键收获地址表id

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date paymentTime;//付款时间

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date deliveryTime;//发货时间

    private long orderSource;//订单来源，2小程序，3app
    private long comment;//是否已评论，2待评论，3已评论
    private String remarks;//用户备注
    private Date createDate;//创建时间
    private String updateId;//更新人

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateDate;//更新时间

    public JsUserOrder() {

    }

    public JsUserOrder(long orderId, long userId, String trueName, String nickname, String phone, Integer productId, Integer courseId, String courseName, String courseIntro, String productName, String productDescription, String roleName, long addressId, long userNumber, long orderNo, long shopId, long orderStatus, long productCount, double priceTotal, double logisticsFee, double freightAmount, long orderLogisticsNumber, long orderType, long orderPaymentChannel, long paymentOrderNo, String receivingAddress, Date paymentTime, Date deliveryTime, long orderSource, long comment, String remarks, Date createDate, String updateId, Date updateDate) {
        this.orderId = orderId;
        this.userId = userId;
        this.trueName = trueName;
        this.nickname = nickname;
        this.phone = phone;
        this.productId = productId;
        this.courseId = courseId;
        this.courseName = courseName;
        this.courseIntro = courseIntro;
        this.productName = productName;
        this.productDescription = productDescription;
        this.roleName = roleName;
        this.addressId = addressId;
        this.userNumber = userNumber;
        this.orderNo = orderNo;
        this.shopId = shopId;
        this.orderStatus = orderStatus;
        this.productCount = productCount;
        this.priceTotal = priceTotal;
        this.logisticsFee = logisticsFee;
        this.freightAmount = freightAmount;
        this.orderLogisticsNumber = orderLogisticsNumber;
        this.orderType = orderType;
        this.orderPaymentChannel = orderPaymentChannel;
        this.paymentOrderNo = paymentOrderNo;
        this.receivingAddress = receivingAddress;
        this.paymentTime = paymentTime;
        this.deliveryTime = deliveryTime;
        this.orderSource = orderSource;
        this.comment = comment;
        this.remarks = remarks;
        this.createDate = createDate;
        this.updateId = updateId;
        this.updateDate = updateDate;
    }

    public void setOrderId(long orderId) {
        this.orderId = orderId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public void setTrueName(String trueName) {
        this.trueName = trueName;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public void setCourseId(Integer courseId) {
        this.courseId = courseId;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public void setCourseIntro(String courseIntro) {
        this.courseIntro = courseIntro;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public void setProductDescription(String productDescription) {
        this.productDescription = productDescription;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public void setAddressId(long addressId) {
        this.addressId = addressId;
    }

    public void setUserNumber(long userNumber) {
        this.userNumber = userNumber;
    }

    public void setOrderNo(long orderNo) {
        this.orderNo = orderNo;
    }

    public void setShopId(long shopId) {
        this.shopId = shopId;
    }

    public void setOrderStatus(long orderStatus) {
        this.orderStatus = orderStatus;
    }

    public void setProductCount(long productCount) {
        this.productCount = productCount;
    }

    public void setPriceTotal(double priceTotal) {
        this.priceTotal = priceTotal;
    }

    public void setLogisticsFee(double logisticsFee) {
        this.logisticsFee = logisticsFee;
    }

    public void setFreightAmount(double freightAmount) {
        this.freightAmount = freightAmount;
    }

    public void setOrderLogisticsNumber(long orderLogisticsNumber) {
        this.orderLogisticsNumber = orderLogisticsNumber;
    }

    public void setOrderType(long orderType) {
        this.orderType = orderType;
    }

    public void setOrderPaymentChannel(long orderPaymentChannel) {
        this.orderPaymentChannel = orderPaymentChannel;
    }

    public void setPaymentOrderNo(long paymentOrderNo) {
        this.paymentOrderNo = paymentOrderNo;
    }

    public void setReceivingAddress(String receivingAddress) {
        this.receivingAddress = receivingAddress;
    }

    public void setPaymentTime(Date paymentTime) {
        this.paymentTime = paymentTime;
    }

    public void setDeliveryTime(Date deliveryTime) {
        this.deliveryTime = deliveryTime;
    }

    public void setOrderSource(long orderSource) {
        this.orderSource = orderSource;
    }

    public void setComment(long comment) {
        this.comment = comment;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public void setUpdateId(String updateId) {
        this.updateId = updateId;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public long getOrderId() {
        return orderId;
    }

    public long getUserId() {
        return userId;
    }

    public String getTrueName() {
        return trueName;
    }

    public String getNickname() {
        return nickname;
    }

    public String getPhone() {
        return phone;
    }

    public Integer getProductId() {
        return productId;
    }

    public Integer getCourseId() {
        return courseId;
    }

    public String getCourseName() {
        return courseName;
    }

    public String getCourseIntro() {
        return courseIntro;
    }

    public String getProductName() {
        return productName;
    }

    public String getProductDescription() {
        return productDescription;
    }

    public String getRoleName() {
        return roleName;
    }

    public long getAddressId() {
        return addressId;
    }

    public long getUserNumber() {
        return userNumber;
    }

    public long getOrderNo() {
        return orderNo;
    }

    public long getShopId() {
        return shopId;
    }

    public long getOrderStatus() {
        return orderStatus;
    }

    public long getProductCount() {
        return productCount;
    }

    public double getPriceTotal() {
        return priceTotal;
    }

    public double getLogisticsFee() {
        return logisticsFee;
    }

    public double getFreightAmount() {
        return freightAmount;
    }

    public long getOrderLogisticsNumber() {
        return orderLogisticsNumber;
    }

    public long getOrderType() {
        return orderType;
    }

    public long getOrderPaymentChannel() {
        return orderPaymentChannel;
    }

    public long getPaymentOrderNo() {
        return paymentOrderNo;
    }

    public String getReceivingAddress() {
        return receivingAddress;
    }

    public Date getPaymentTime() {
        return paymentTime;
    }

    public Date getDeliveryTime() {
        return deliveryTime;
    }

    public long getOrderSource() {
        return orderSource;
    }

    public long getComment() {
        return comment;
    }

    public String getRemarks() {
        return remarks;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public String getUpdateId() {
        return updateId;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    @Override
    public String toString() {
        return "JsUserOrder{" +
                "orderId=" + orderId +
                ", userId=" + userId +
                ", trueName='" + trueName + '\'' +
                ", nickname='" + nickname + '\'' +
                ", phone='" + phone + '\'' +
                ", productId=" + productId +
                ", courseId=" + courseId +
                ", courseName='" + courseName + '\'' +
                ", courseIntro='" + courseIntro + '\'' +
                ", productName='" + productName + '\'' +
                ", productDescription='" + productDescription + '\'' +
                ", roleName='" + roleName + '\'' +
                ", addressId=" + addressId +
                ", userNumber=" + userNumber +
                ", orderNo=" + orderNo +
                ", shopId=" + shopId +
                ", orderStatus=" + orderStatus +
                ", productCount=" + productCount +
                ", priceTotal=" + priceTotal +
                ", logisticsFee=" + logisticsFee +
                ", freightAmount=" + freightAmount +
                ", orderLogisticsNumber=" + orderLogisticsNumber +
                ", orderType=" + orderType +
                ", orderPaymentChannel=" + orderPaymentChannel +
                ", paymentOrderNo=" + paymentOrderNo +
                ", receivingAddress='" + receivingAddress + '\'' +
                ", paymentTime=" + paymentTime +
                ", deliveryTime=" + deliveryTime +
                ", orderSource=" + orderSource +
                ", comment=" + comment +
                ", remarks='" + remarks + '\'' +
                ", createDate=" + createDate +
                ", updateId='" + updateId + '\'' +
                ", updateDate=" + updateDate +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        JsUserOrder that = (JsUserOrder) o;
        return orderId == that.orderId &&
                userId == that.userId &&
                addressId == that.addressId &&
                userNumber == that.userNumber &&
                orderNo == that.orderNo &&
                shopId == that.shopId &&
                orderStatus == that.orderStatus &&
                productCount == that.productCount &&
                Double.compare(that.priceTotal, priceTotal) == 0 &&
                Double.compare(that.logisticsFee, logisticsFee) == 0 &&
                Double.compare(that.freightAmount, freightAmount) == 0 &&
                orderLogisticsNumber == that.orderLogisticsNumber &&
                orderType == that.orderType &&
                orderPaymentChannel == that.orderPaymentChannel &&
                paymentOrderNo == that.paymentOrderNo &&
                orderSource == that.orderSource &&
                comment == that.comment &&
                Objects.equals(trueName, that.trueName) &&
                Objects.equals(nickname, that.nickname) &&
                Objects.equals(phone, that.phone) &&
                Objects.equals(productId, that.productId) &&
                Objects.equals(courseId, that.courseId) &&
                Objects.equals(courseName, that.courseName) &&
                Objects.equals(courseIntro, that.courseIntro) &&
                Objects.equals(productName, that.productName) &&
                Objects.equals(productDescription, that.productDescription) &&
                Objects.equals(roleName, that.roleName) &&
                Objects.equals(receivingAddress, that.receivingAddress) &&
                Objects.equals(paymentTime, that.paymentTime) &&
                Objects.equals(deliveryTime, that.deliveryTime) &&
                Objects.equals(remarks, that.remarks) &&
                Objects.equals(createDate, that.createDate) &&
                Objects.equals(updateId, that.updateId) &&
                Objects.equals(updateDate, that.updateDate);
    }

    @Override
    public int hashCode() {
        return Objects.hash(orderId, userId, trueName, nickname, phone, productId, courseId, courseName, courseIntro, productName, productDescription, roleName, addressId, userNumber, orderNo, shopId, orderStatus, productCount, priceTotal, logisticsFee, freightAmount, orderLogisticsNumber, orderType, orderPaymentChannel, paymentOrderNo, receivingAddress, paymentTime, deliveryTime, orderSource, comment, remarks, createDate, updateId, updateDate);
    }
}
